package cv.vender.para;

import cv.vender.clsToolBox;

/**
 * Created by Administrator on 2018/1/27.
 *
 */

public class clsTradeTypeStatistic {
    int trade_type;
    String trade_type_name;
    int jine;
    int bishu;

    public int getTrade_type() {
        return trade_type;
    }

    public void setTrade_type(int trade_type) {
        this.trade_type = trade_type;
    }

    public String getTrade_type_name() {
        return trade_type_name;
    }

    public void setTrade_type_name(String trade_type_name) {
        this.trade_type_name = trade_type_name;
    }

    public int getJine() {
        return jine;
    }

    public void setJine(int jine) {
        this.jine = jine;
    }

    public int getBishu() {
        return bishu;
    }

    public void setBishu(int bishu) {
        this.bishu = bishu;
    }

    public int FillParaFromBytes(byte[] data, int index) {
        bishu= clsToolBox.little_byte2int(data,index);
        index+=4;
        jine= clsToolBox.little_byte2int(data,index);
        index+=4;
        return index;
    }

    public int FillParaToBytes(byte[] buf, int i) {
        i= clsToolBox.intToByte(bishu,buf,i);
        i= clsToolBox.intToByte(jine,buf,i);
        return i;
    }

    public void CopyObj(clsTradeTypeStatistic p1) {
        this.bishu=p1.bishu;
        this.jine=p1.jine;
        this.trade_type=p1.trade_type;
        this.trade_type_name=p1.trade_type_name;
    }

    public void Add(int i, int cashAmount) {
        this.jine+=cashAmount;
        this.bishu+=i;
    }

    public void Clr() {
        this.bishu=0;
        this.jine=0;
    }
}
